package org.dulong.service.impl;

import org.dulong.service.IAopService;

import javax.security.auth.login.AccountException;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-9-23
 * Time: 下午1:18
 * To change this template use File | Settings | File Templates.
 */
public class IAopServiceImpl implements IAopService {
    private String name;

    @Override
    public void withAop() throws Exception {
        System.out.println("有Aop的函数在运行: name = " + name);
        if (name.length() == 0) {
            throw new AccountException("name属性不能为空");
        }
    }

    @Override
    public void withoutAop() throws Exception {
        System.out.println("没有Aop的函数在运行,name=" + name);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
